{extend name="layout" /}
{block name="title"}博主信息{/block}
{block name="style"} <style>
    .layui-btn-small {
        padding: 0 15px;
    }

    .layui-form-checkbox {
        margin: 0;
    }

    tr td:not(:nth-child(0)),
    tr th:not(:nth-child(0)) {
        text-align: center;
    }

    #dataConsole {
        text-align: center;
    }
    /*分页页容量样式*/
    /*可选*/
    .layui-laypage {
        display: block;
    }

    /*可选*/
    .layui-laypage > * {
        float: left;
    }
    /*可选*/
    .layui-laypage .laypage-extend-pagesize {
        float: right;
    }
    /*可选*/
    .layui-laypage:after {
        content: ".";
        display: block;
        height: 0;
        clear: both;
        visibility: hidden;
    }

    /*必须*/
    .layui-laypage .laypage-extend-pagesize {
        height: 30px;
        line-height: 30px;
        margin: 0px;
        border: none;
        font-weight: 400;
    }
    /*分页页容量样式END*/
</style>{/block}
{block name="body"}

<blockquote class="layui-elem-quote layui-text">
    修改配置
</blockquote>

<form class="layui-form" action="">
    <div class="layui-form-item">
        <label class="layui-form-label">博主名</label>
        <div class="layui-input-block">
            <input type="text" name="author"  autocomplete="off" placeholder="博主名字" class="layui-input" value="{$config.author}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">小介绍</label>
        <div class="layui-input-block">
            <input type="text" name="short_desc" autocomplete="off" placeholder="小介绍" class="layui-input" value="{$config.short_desc}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">地址</label>
        <div class="layui-input-block">
            <input type="text" name="address"  autocomplete="off" placeholder="地址" class="layui-input"value="{$config.address}" >
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">QQ</label>
        <div class="layui-input-block">
            <input type="text" name="qq"  autocomplete="off" placeholder="QQ" class="layui-input" value="{$config.qq}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">git</label>
        <div class="layui-input-block">
            <input type="text" name="git"  autocomplete="off" placeholder="git" class="layui-input" value="{$config.git}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-block">
            <button class="layui-btn" style="width:230px;" lay-submit="" lay-filter="save">保存操作</button>
        </div>
    </div>
</form>
{/block}
{block name="script"}
<!-- layui规范化用法 -->
<script type="text/javascript">
    layui.define(['form','element'],function(){
        var form = layui.form();
        $('body').keydown(function (e) {
            if (e.keyCode == 13) {  //Enter键
                $('button[lay-filter=save]').click();
            }
        });
        form.on('submit(save)', function (data) {
            var index = layer.load(1);
            var url = baseUrl+"api/config/save";
            var data = $('form').serialize();
            urlAjax(url,data,function(data){
                    layer.close(index);
                    if(data.status){
                        layer.msg(data.info, { icon: 5 });
                    }else{
                        layer.msg(data.info, { icon: 6 });
                        layer.closeAll('page');
                    }
                },
                function(){
                    layer.close(index);
                    layer.msg('网络错误，请重试', { icon: 5 });
                },'POST');
            return false;
        });
    });
</script>

{/block}